package view.frame.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;

public abstract class MenuItemActionPerformed implements ActionListener {

	private JFrame frame;
	
	private JPanel panel;
	
	public MenuItemActionPerformed(JFrame frame){
		this.frame = frame;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		panel = this.createPanel();
		panel.setVisible(true);
		MenuItemActionPerformed.this.frame.setContentPane(panel);
		MenuItemActionPerformed.this.frame.revalidate();
	}

	public abstract JPanel createPanel();
}
